home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / CINEMA 4D CE 6 / Libs / geuserarea.cox < prev    next >
Text File  |  2000-06-28  |  1KB  |  86 lines

  1. class GeUserArea : _GeUserArea
  2. {
  3.         var dlg,uid;
  4.  
  5.     public:
  6.         GeUserArea(id,dialog);
  7.  
  8.         Message(msg);
  9.  
  10.         Init();
  11.         GetUserWidth();
  12.         GetUserHeight();
  13.         Sized(w,h);
  14.         Draw(x1,y1,x2,y2);
  15.         InputEvent(msg);
  16.         CoreMessage(id,msg);
  17.         Timer(msg);
  18.  
  19.         LayoutChanged();
  20.  
  21.         FillBitmapBackground(bmp,offsetx,offsety);
  22. }
  23.  
  24. GeUserArea::Init()  {}
  25. GeUserArea::GetUserWidth() { return 0; }
  26. GeUserArea::GetUserHeight() {return 0; }
  27. GeUserArea::Sized(w,h)  {}
  28. GeUserArea::Draw(x1,y1,x2,y2)  {}
  29. GeUserArea::InputEvent(msg)  {}
  30. GeUserArea::CoreMessage(id,msg) {}
  31. GeUserArea::Timer(msg) {}
  32. GeUserArea::FillBitmapBackground(bmp,offsetx,offsety)
  33. {
  34.     DrawBitmap(bmp,offsetx,offsety,-0x12345,-0x12345,-0x12345,-0x12345,-0x12345,-0x12345,-0x12345);
  35. }
  36.  
  37. GeUserArea::GeUserArea(t_id,t_dialog)
  38. {
  39.     super(t_id,t_dialog);
  40.     dlg = t_dialog;
  41.     uid = t_id;
  42. }
  43.  
  44. GeUserArea::Message(msg)
  45. {
  46.     switch (msg->GetId())
  47.     {
  48.         case BFM_CALCSIZE:
  49.             _SetMinSize(GetUserWidth(),GetUserHeight());
  50.         break;
  51.  
  52.         case BFM_SIZED:
  53.             Sized(GetWidth(),GetHeight());
  54.         break;
  55.  
  56.         case BFM_INITVALUES:
  57.             Init();
  58.         break;
  59.  
  60.         case BFM_DRAW:
  61.             Draw(0,0,GetWidth()-1,GetHeight()-1);
  62.             return TRUE;
  63.         
  64.         case BFM_INPUT:
  65.             InputEvent(msg);
  66.         break;
  67.  
  68.         case BFM_CORE_MESSAGE:
  69.         {
  70.             var id = msg->GetInt(BFM_CORE_ID);
  71.             return CoreMessage(id,msg);
  72.         }
  73.  
  74.         case BFM_TIMER_MESSAGE:
  75.             Timer(msg);
  76.         break;
  77.     }
  78. }
  79.  
  80. GeUserArea::LayoutChanged()
  81. {
  82.     if (dlg) dlg->LayoutChanged(uid);
  83. }
  84.  
  85.  
  86.